package action.manage;

import java.util.List;

import model.app.AppLoantype;

import service.credit.AppLoantypeService;
import core.action.BaseAction;
import exception.Exceptions;

public class LoanOfModeManage extends BaseAction{
	private AppLoantypeService appLoantypeService;
	private List<AppLoantype> appLoantypeList;
	
	private int isdone1;
	private int isdone2;
	private int isdone3;
	private int isdone4;
	
	public String execute(){
		this.appLoantypeList = this.appLoantypeService.getAllLoanTypeList();
		return "success";
	}
	
	public String save() throws Exceptions{
		this.appLoantypeList = this.appLoantypeService.getAllLoanTypeList();
		appLoantypeList.get(0).setIsdone(isdone1);
		appLoantypeList.get(1).setIsdone(isdone2);
		appLoantypeList.get(2).setIsdone(isdone3);
		appLoantypeList.get(3).setIsdone(isdone4);
		this.appLoantypeService.save(appLoantypeList);
		MessageJump("贷款方式设置成功", "loanofmodemanage");
		return "message";
	}

	public AppLoantypeService getAppLoantypeService() {
		return appLoantypeService;
	}

	public void setAppLoantypeService(AppLoantypeService appLoantypeService) {
		this.appLoantypeService = appLoantypeService;
	}

	public List<AppLoantype> getAppLoantypeList() {
		return appLoantypeList;
	}

	public void setAppLoantypeList(List<AppLoantype> appLoantypeList) {
		this.appLoantypeList = appLoantypeList;
	}

	public int getIsdone1() {
		return isdone1;
	}

	public void setIsdone1(int isdone1) {
		this.isdone1 = isdone1;
	}

	public int getIsdone2() {
		return isdone2;
	}

	public void setIsdone2(int isdone2) {
		this.isdone2 = isdone2;
	}

	public int getIsdone3() {
		return isdone3;
	}

	public void setIsdone3(int isdone3) {
		this.isdone3 = isdone3;
	}

	public int getIsdone4() {
		return isdone4;
	}

	public void setIsdone4(int isdone4) {
		this.isdone4 = isdone4;
	}
	
	

}
